package com.github.thinwonton.springboot.showcase.web.exception.handle.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/index")
public class IndexController {

    @RequestMapping("")
    public ModelAndView index() {
        ModelAndView modelAndView = new ModelAndView("index");
        modelAndView.addObject("message", "spring boot!");
        return modelAndView;
    }

    @RequestMapping("/error")
    public ModelAndView error() {
        throw new RuntimeException("获取页面数据出问题鸟");
    }
}
